package com.softer.wxzj.controller;


import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.common.util.ShiroUser;
import com.softer.wxzj.entity.FlowAuditdetail;
import com.softer.wxzj.service.FlowAuditdetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * FlowAuditdetailController class
 * @author zcz
 * @date 2019/1/16
 */
@RestController
@RequestMapping("/flowAuditdetail")
@Slf4j
public class FlowAuditdetailController {
    @Autowired
    FlowAuditdetailService flowAuditdetailService;

    @RequestMapping("/add")
    public CommonResult add(FlowAuditdetail flowAuditdetail) {
        flowAuditdetail.setCreater(ShiroUser.getUserName());
        return flowAuditdetailService.insert(flowAuditdetail);
    }
    @RequestMapping("/update")
    public CommonResult update(FlowAuditdetail flowAuditdetail) {
        return flowAuditdetailService.update(flowAuditdetail);
    }
    @RequestMapping("/delete")
    public CommonResult delete(String id) {
        return flowAuditdetailService.delete(id);
    }
    @RequestMapping("/getList")
    public PageInfo<FlowAuditdetail> getRoleList(Page page, FlowAuditdetail flowAuditdetail) {
        return flowAuditdetailService.getList(page,flowAuditdetail);
    }


}
